import request from '@/utils/request';
export type GetCommentParamsType = {
  type: 'a' | 'c';
  source: string;
};
export const getCommentByIdAPI = (params: GetCommentParamsType) => {
  return request({
    url: '/v1_0/comments',
    params,
  });
};

export type CommentParasType = {
  target: string;
  content: string;
  art_id?: string;
};
export const sendCommentAPI = (data: CommentParasType) => {
  return request({ url: '/v1_0/comments', method: 'post', data });
};

export const likeCommentAPI = (target: string) => {
  return request({ url: '/v1_0/comment/likings', method: 'post', data: { target } });
};

export const dislikeCommentAPI = (target: string) => {
  return request({ url: '/v1_0/comment/likings/' + target, method: 'delete' });
};
